#pragma once
#include <cmath>
namespace Math
{
	const float PI = 3.1415926535f;

	template<typename T>
	inline T ToRadian(const T& degree)
	{
		return degree * PI/180.0f;
	}

	template<typename T>
	inline T ToDegree(const T& radian)
	{
		return radian*180.0f/PI;
	}

	template<typename T>
	inline T Sqrt(const T& value)
	{
		return sqrt(value);
	}

	template<typename T>
	inline T Max(const T& left, const T& right)
	{
		return left > right ? left : right;
	}

	template<typename T>
	inline T Min(const T& left, const T& right)
	{
		return left > right ? right : left;
	}

	template<typename T>
	inline T Clamp(const T& value, const T& minValue, const T& maxValue)
	{
		return Min(maxValue, Max(value, minValue));
	}

	template<typename T>
	inline T Sin(const T& radian)
	{
		return sin(radian);
	}

	template<typename T>
	inline T Cos(const T& radian)
	{
		return cos(radian);
	}

	template<typename T>
	inline T Tan(const T& radian)
	{
		return tan(radian);
	}

	template<typename T>
	inline T Cot(const T& radian)
	{
		return 1.0f/tan(radian);
	}

	template<typename T>
	inline T ArcSin(const T& value)
	{
		return asin(value);
	}

	template<typename T>
	inline T ArcCos(const T& value)
	{
		return acos(value);
	}

	template<typename T>
	inline T ArcTan(const T& value)
	{
		return atan(value);
	}

	template<typename T>
	inline T ArcTan2(const T& value)
	{
		return atan2(value);
	}
}
